Hi all,
i have a problem when i try to see the appointments of a room.
I created a service with the EWS Managed API using my own credentials (user@mydomain.com). Then i created a method to return a list of custom objects named RoomMeeting by passing my service and the smtp address of the room mailbox (myroom@mydomain.com).
Here is the method :
public static ObservableCollection<RoomMeeting> FindAppointmentsForTodayTomorrow(ExchangeService service, string roomAddress)
{
ObservableCollection<RoomMeeting> meetings = new ObservableCollection<RoomMeeting>();
CalendarView calendarView = new CalendarView(DateTime.Now, DateTime.Today + TimeSpan.FromDays(1));
calendarView.PropertySet = new PropertySet();
calendarView.PropertySet.Add(AppointmentSchema.Start);
calendarView.PropertySet.Add(AppointmentSchema.End);
calendarView.PropertySet.Add(AppointmentSchema.Organizer);
calendarView.PropertySet.Add(AppointmentSchema.Subject);
calendarView.PropertySet.Add(AppointmentSchema.Duration);
calendarView.PropertySet.Add(AppointmentSchema.Location);
calendarView.MaxItemsReturned = 10;
Mailbox mailbox = new Mailbox(roomAddress);
FolderId calendarFolder = new FolderId(WellKnownFolderName.Calendar, mailbox);
// var result = service.FindAppointments(WellKnownFolderName.Calendar, calendarView);
FindItemsResults<Item> response = service.FindItems(WellKnownFolderName.Calendar, calendarView);
for (int i = 0; i < response.Items.Count; i++)
{
if (response.Items[i] is Appointment)
{
Appointment appointment = (Appointment)response.Items[i];
RoomMeeting meeting = new RoomMeeting();
meeting.Duration = appointment.Duration;
meeting.Start = appointment.Start;
meeting.End = appointment.End;
meeting.Subject = appointment.Subject;
meeting.Owner = appointment.Organizer.Name;
meetings.Add(meeting);
}
}
return meetings;
}
The problem is that i only get the appointments made by user@mydomain.com and not all the appointments relative to myroom@domain.com.
How can i do that ?
Thanks for the help
- Edited by GraphicStream Wednesday, January 30, 2013 2:46 AM